package com.gy.hadoop.hadoopRPC;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;

public class NameNodeRpcServer implements ClientProtocol {

    public String mkdir(String path) {
        String rt = String.format("服务端创建了目录:%s", path);
        System.out.println(rt);
        return rt;
    }

    public static void main(String[] args) throws IOException {
        new RPC.Builder(new Configuration())
                .setBindAddress("localhost")
                .setPort(9999)
                .setProtocol(ClientProtocol.class)
                .setInstance(new NameNodeRpcServer())
                .build()
                .start();


    }


}
